<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./myaxios.js"></script>
</head>
<body>
    <button>发送请求</button>
</body>
<script>
    let btn = document.querySelector('button')
    btn.addEventListener('click',()=>{
        console.log(myaxios)
        // myaxios.get('http://127.0.0.1:666/name').then(res=>{
        //     console.log(res)
        // }).catch(err=>{
        //     console.log(err)
        // })

        myaxios.post('http://127.0.0.1:666/name',{name:'Jiimy',age:22}).then(res=>{
            console.log(res)
        }).catch(err=>{
            console.log(err)
        })
    })
</script>
</html>